<?php

include_once("../../../../common/modules/checkA.php");
include_once("../../../../../config.php");

$table = $table_prefix."unit";
$unitList = select_lines_all_items($table,"","",10);

foreach ($unitList as $x=> $x_value){
    $unit[$x]['nid'] = $x_value['nid'];
    $unit[$x]['name'] = $x_value['name'];
}

$sqlstr="SELECT COUNT(*) FROM $table ";

$query = do_query($sqlstr);
$sum = mysqli_fetch_array($query)[0];

$result["code"] = 0;
$result["msg"] = "";
$result["count"] = $sum;
$result["data"] = $unit;
echo json_encode($result,JSON_UNESCAPED_UNICODE);

?>
